// ==UserScript==
// @name          Shelter from a Blizzard
// @description   Removes the warning page when clicking on an external link in Blizzard Entertainment's World of Warcraft forums
// @match       http://forums.worldofwarcraft.com/*
// ==/UserScript==

(function () {
	var allLinks, thisLink, newLink, newLinkText;
	allLinks = document.evaluate(
		'//a[@onclick]',
		document,
		null,
		XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
		null);

	for (var i = 0; i < allLinks.snapshotLength; i++)
	{
		thisLink = allLinks.snapshotItem(i);

		newLink=document.createElement('a');
		newLink.setAttribute('href',thisLink.innerHTML);
		newLinkText=document.createTextNode(thisLink.innerHTML);
		newLink.appendChild(newLinkText);

		thisLink.parentNode.insertBefore(newLink, thisLink);
		thisLink.parentNode.removeChild(thisLink);
	}
})()
